package dyyx;

import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;


@Component
public class AppListener1 implements ApplicationListener<WebServerInitializedEvent> {
	@Override
    public void onApplicationEvent(WebServerInitializedEvent event) {
        int serverPort = event.getWebServer().getPort();
        
        AppConfigUtil.setServerPort(serverPort);
        
        System.out.println("serverPort="+serverPort);
        
    }
}
